package com.android.scj.tc.bean;

/**
 *
 * 初始化返回
 * @author LiuYaDong
 */
public class InitResponse{
	/**
	 *  0	1	RSUStatus
	 1	1	RSUManuID
	 2	3	RSUIndividualID
	 5	2	RSUVersion
	 7	10	Reserved
	 */
	private static final String cmdcode = "E0";
	private String RSUStatus = "00";
	private String RSUManuID = "00";
	private String RSUIndividualID = "000000";
	private String RSUVersion = "0000";
	private String Reserved = "00000000000000000000";
	private CMD_55AA cmd = null;

	private InitResponse(){}
	public static InitResponse disassemble(String cmdstr) {
		InitResponse io = new InitResponse();
		io.cmd = CMD_55AA.disassemble(cmdstr);
		if(io.cmd == null)return null;
		if(!io.cmd.getCMD().equals(cmdcode))return null;
		if(io.cmd.getDATA().length() < 14)return null;
		io.RSUStatus = io.cmd.getDATA().substring(0,2) ;
		io.RSUManuID = io.cmd.getDATA().substring(2,4) ;
		io.RSUIndividualID =io.cmd.getDATA().substring(4,10) ;
		io.RSUVersion = io.cmd.getDATA().substring(10,14) ;
		io.Reserved = io.cmd.getDATA().substring(14) ;
		return io;

	}


	public String getRSUStatus() {
		return RSUStatus;
	}
	public String getRSUManuID() {
		return RSUManuID;
	}
	public String getRSUIndividualID() {
		return RSUIndividualID;
	}
	public String getRSUVersion() {
		return RSUVersion;
	}
	public String getReserved() {
		return Reserved;
	}




}
